
load('summary_data/fig4.rda')

g4 = 
  ggplot(out, aes(as.character(nq_bin),reliance_diff/1e6,fill=if_else(reliance_diff<0,'cornflowerblue','indianred2'))) +
  geom_bar(stat='identity',position=position_dodge()) +
  geom_text(aes(label = round(reliance_diff/1e6,0), y = (5 * sign(reliance_diff)) + reliance_diff/1e6),size=3.5) +
  facet_wrap(~cycle,nrow=1) +
  scale_y_continuous(labels=scales::label_dollar(suffix='M')) +
  scale_fill_manual(values = c('cornflowerblue','indianred2')) +
  labs(x='National Wealth Bin', y = '(R-D) Diff. in Funds Raised from Bin',
       #subtitle = 'Partisan Difference in Total Funds'
  ) +
  theme_light() +
  theme(strip.background = element_rect(fill='white'),strip.text = element_text(color='black',size=14),
        legend.position='none', text = element_text(face='bold'), title = element_text(size = 13)) +
  geom_hline(yintercept = 0, linetype='dashed',color='grey1') +
  theme(axis.text.x = element_text(angle=20,size=8,vjust=0.8))

ggsave(filename = 'figures/fig4.pdf', plot = g4, width = 7, height = 4, units = 'in')
